﻿package Map
{
	import Component.Avatar;
	import Map.Model.Builder;
	import flash.display.MovieClip;
	import Component.Map;

	public class Spawn extends MovieClip implements Builder
	{
		private var _avatar:Avatar;
		public function get avatar():Avatar
		{
			return _avatar;
		}

		public function Spawn()
		{
			// hide Spawn
			visible = false;
			// create an avatar
			_avatar = new Avatar();
		}

		public function reset(map:Map):void
		{
			// move avatar to spawn position
			_avatar.x = x;
			_avatar.y = y;
			map.display(_avatar);
		}

	}

}